//
//  Book.m
//  OCDay2
//
//  Created by dllo on 16/5/23.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "Book.h"
#import "Student.h"
@implementation Book
-(instancetype)initWithName:(NSString *)name withPrice:(CGFloat)price withAuthor:(NSString *)author{
    self = [super init];
    if(self){
        _name = name;
        _price = price;
        _author = author;
    }
    return self;
}
+(instancetype)bookWithName:(NSString *)name withPrice:(CGFloat)price withAuthor:(NSString *)author{
    Book *book = [[Book alloc] initWithName:name withPrice:price withAuthor:author];
    return book;
}
-(void)myPrint{
    NSLog(@"书名:%@ 价格:%.2f美元 作者:%@",_name,_price,_author);
}
-(void)setName:(NSString *)name{
    _name = name;
}
-(NSString *)name{
    return _name;
}
-(void)setPrice:(CGFloat)price{
    _price = price;
}
-(CGFloat)price{
    return _price;
}
-(void)setAuthor:(NSString *)author{
    _author = author;
}
-(NSString *)author{
    return _author;
}
-(void)setStu:(Student *)stu{
    _stu = stu;
}
-(Student *)stu{
    return _stu;
}


@end
